import { Cascader } from 'element-ui'

export default {
  name: 'AsamaCascader',
  data () {
    return {}
  },
  beforeCreate () {

  },
  created () {

  },

  methods: {
    getCurrentLabels () {
      var checkNodes = this.panel.getCheckedNodes(false)
      if (checkNodes && checkNodes.length > 0) {
        // let nodes = checkNodes[0].pathNodes
        let nodes = checkNodes[0] ? checkNodes[0].pathNodes : []

        var labels = []

        if (nodes && nodes.length > 0) {
          for (var i = 0; i < nodes.length; i++) {
            labels.push(nodes[i].label)
          }
        }

        return labels
      }

      return []
    }
  },

  extends: Cascader
}
